介紹兩種樣板建立方式
1.template
  const app = Vue.createApp({
    data() {
      return {
        array: [1, 2, 3],
        componentName: 'alert'
      };
    },
  })
  app.component('alert', {
    template: `<div class="alert alert-primary" role="alert">
      範例ㄧ
    </div>`,
  });
  app.mount('#app');
  <h4>template</h4>
  <alert></alert>
2.x-template
  const app = Vue.createApp({
    data() {
      return {
        array: [1, 2, 3],
        componentName: 'alert'
      };
    },
  })
  app.component('alert2',{
    template:'#alert-template'
  })
  app.mount('#app');
<script type="text/x-template" id="alert-template">
  <div class="alert alert-primary" role="alert">
    x-template所建立的元件
  </div>
</script>
  <h4>x-template</h4>
  <alert2></alert2>

.
知識點來源:六角課程
以上是今天所提供知識點如有誤,再請務必在下面留言~